class ChatRoom {
    public static showMessage(user: User, message: string) {
        const date: string = new Date().toISOString();
        console.log(`${date} [${user.getName()}]: ${message}`);
    }
}

class User {
    private name: string;
    public getName(): string {
        return this.name;
    }
    public setName(name: string): void {
        this.name = name;
    }
    public constructor(name: string) {
        this.name = name;
    }
    public sendMessage(message: string): void {
        ChatRoom.showMessage(this, message);
    }
}

function main() {
    const user1: User = new User("Alice");
    const user2: User = new User("Bob");
    user1.sendMessage("Hello, Bob!");
    user2.sendMessage("Hi, Alice!");
}

main();
